Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@smithy/util-hex-encoding
Advanced tools
Converts binary buffers to and from lowercase hexadecimal encoding
@smithy/util-hex-encoding is a utility package for encoding and decoding hexadecimal strings. It is part of the Smithy framework, which is used for building SDKs and other tools.
Hex Encoding
This feature allows you to convert a buffer or byte array into a hexadecimal string.
const { toHex } = require('@smithy/util-hex-encoding');
const buffer = Buffer.from('hello');
const hexString = toHex(buffer);
console.log(hexString); // Output: 68656c6c6f
Hex Decoding
This feature allows you to convert a hexadecimal string back into a buffer or byte array.
const { fromHex } = require('@smithy/util-hex-encoding');
const hexString = '68656c6c6f';
const buffer = fromHex(hexString);
console.log(buffer.toString()); // Output: hello
The 'buffer' package is a core Node.js module that provides a way of handling binary data. It includes methods for converting buffers to and from hexadecimal strings, similar to @smithy/util-hex-encoding. However, 'buffer' is more comprehensive and includes additional functionalities for working with binary data.
The 'hex2ascii' package provides simple utilities for converting hexadecimal strings to ASCII and vice versa. It is similar to @smithy/util-hex-encoding but focuses specifically on ASCII conversions, making it less versatile for general binary data handling.
The 'crypto-js' package is a widely-used library for cryptographic algorithms. It includes utilities for encoding and decoding hexadecimal strings, among other features. Compared to @smithy/util-hex-encoding, 'crypto-js' offers a broader range of cryptographic functionalities.
FAQs
Converts binary buffers to and from lowercase hexadecimal encoding
The npm package @smithy/util-hex-encoding receives a total of 13,144,603 weekly downloads. As such, @smithy/util-hex-encoding popularity was classified as popular.
We found that @smithy/util-hex-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.